﻿
#include "Test/Delegate.h"




ADelegate::ADelegate()
{
	PrimaryActorTick.bCanEverTick = true;

	// 绑定委托
	OnLoadMeshDelegate.AddDynamic(this, &ADelegate::OnLoadMesh);
}

void ADelegate::BeginPlay()
{
	Super::BeginPlay();
	
}

void ADelegate::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
}

void ADelegate::OnLoadMesh(const FString& MeshPath)
{	
	UE_LOG(LogTemp, Warning, TEXT("OnLoadMesh: %s"), *MeshPath);	
}


void ADelegate::OnLoadMeshBroadcast()
{
	// 广播委托
	OnLoadMeshDelegate.Broadcast(LoadMeshPath);
}
